# -*- coding:utf-8 -*-
import re

string = 'ababa5b5c;def6;g\nhi/j67abab/${sum_data(9, 2)}'
# 分组
res3 = re.findall(r'(ab){2}', "ababa5bab3ad")
print(res3)
"""
结果：
['ab']
"""
res4 = re.findall('\\${(.*?)}', string)
print(res4)
"""
结果：
['sum_data(9, 2)']
"""